#include <iostream>
using namespace std;

int main()
{
    const int MaxN = 100, CourseN = 5;
    int n, score[MaxN][CourseN + 1] = {0};
    float aver[CourseN + 1] = {0.0};

    bool bk = false;
    for (n = 0; n < MaxN; n++)
    {
        for (int j = 0; j < CourseN; j++)
        {
            cin >> score[n][j];
            if (score[n][0] < 0)
                bk = true;
        }
        if (bk)
        {
            break;
        }
    }

    cout << "start" << endl;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < CourseN; j++)
        {
            score[i][CourseN] += score[i][j];
        }
    }

    for (int j = 0; j < CourseN + 1; j++)
    {
        for (int i = 0; i < n; i++)
        {
            aver[j] += score[i][j];
        }
        aver[j] /= n;
    }

    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < CourseN + 1; j++)
        {
            cout << score[i][j] << '\t';
        }
        cout << endl;
    }

    cout << "--------" << endl;

    for (int i = 0; i < CourseN+1; i++)
    {
        cout << aver[i] << '\t';
    }
    cout << endl;
}